<template>
	<view class="SelectDate">
		<u-popup :show="filteringShow" round="32rpx" @close="onClose">
			<SelectDate @dateRange="onDateRange" />
		</u-popup>
	</view>
</template>

<script>
	import SelectDate from "@/components/select-date/select-date"
	export default {
		components: { SelectDate },
		data() {
			return {
				filteringShow: true
			}
		},
		methods: {
			onClose() {
				uni.navigateBack({});
			},
			onDateRange(item) {
				console.log('onDateRange', item)
				let pages = getCurrentPages(); //获取当前页面
				let beforePage = pages[pages.length - 2] //获取上一个页面的实例
				beforePage.$vm.params.startTime = item.startTime //调用上一页面方法
				beforePage.$vm.params.endTime = item.endTime //调用上一页面方法
				this.onClose()
			}
		}
	}
</script>

<style>

</style>